<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>DOM节点借用Array原型方法</title>
  </head>
  <body>
    <button message="houdunren" class="red">houdunren</button>
    <button message="hdcms">hdcms</button>
  </body>
  <script>
    let btns = document.querySelectorAll("button");
    let btn = Array.prototype.filter.call(btns, (item) => {
      return item.hasAttribute("class");
    });
    console.log(btn[0].innerHTML);
  </script>
</html>
